﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Data;
using TidyBlog.Data.Mapping;

namespace TidyBlog.Entity
{
    /// <summary>
    /// 用户实体类
    /// </summary>
    [Table(Name = "TidyBlog_Setup", IsIgnoreDelete = true, IsIgnoreInsert = true, IsIgnoreList = true)]
    public class Setup : ICloneable
    {
        /// <summary>
        /// 网站是否开放（0-关闭，1-开放）
        /// </summary>
        [Column]
        public byte IsOpen { get; set; }
        /// <summary>
        /// 网站关闭原因
        /// </summary>
        [Column(DataType = DbType.String), DisplayFormat(ConvertEmptyStringToNull = false)]
        public string CloseReason { get; set; }
        /// <summary>
        /// 网站名
        /// </summary>
        [Column(DataType = DbType.String, Length = 50), DisplayFormat(ConvertEmptyStringToNull = false)]
        public string SiteName { get; set; }
        /// <summary>
        /// 网站域名
        /// </summary>
        [Column(DataType = DbType.String, Length = 30), DisplayFormat(ConvertEmptyStringToNull = false)]
        public string SiteDomain { get; set; }
        /// <summary>
        /// 关键字
        /// </summary>
        [Column(DataType = DbType.String, Length = 255), DisplayFormat(ConvertEmptyStringToNull = false)]
        public string Keywords { get; set; }
        /// <summary>
        /// 网站介绍
        /// </summary>
        [Column(DataType = DbType.String), DisplayFormat(ConvertEmptyStringToNull = false)]
        public string Description { get; set; }
        /// <summary>
        /// 禁止IP，多个IP用换行隔开
        /// </summary>
        [Column, DisplayFormat(ConvertEmptyStringToNull = false)]
        public string ForbiddenIP { get; set; }
        /// <summary>
        /// 时区
        /// </summary>
        [Column]
        public double TimeZone { get; set; }
        /// <summary>
        /// 评论是否开放：0-关闭，1-需审核，2-完全开放
        /// </summary>
        [Column]
        public byte CommentLimit { get; set; }
        /// <summary>
        /// 评论最小字数
        /// </summary>
        [Column]
        public byte MinCommentSize { get; set; }
        /// <summary>
        /// 评论最大字数
        /// </summary>
        [Column]
        public short MaxCommentSize { get; set; }
        /// <summary>
        /// 评论间隔，单位为秒，0为不限制
        /// </summary>
        [Column]
        public byte CommentInterval { get; set; }


        public Object Clone()
        {
            return this.MemberwiseClone();
        }
    }
}